import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'

// https://vite.dev/config/
export default defineConfig({
    plugins: [react()],
    css: {
        modules: {
            localsConvention: 'camelCase',
            generateScopedName: '[name]__[local]___[hash:base64:5]',
        }
    },
    resolve: {
        alias:{
            '@cmx': path.resolve(__dirname, './src/cmx'),
            '@api': path.resolve(__dirname, './src/api')
        }
    },
    server:{
        proxy:{
            '/api': {
                target: 'http://localhost:8080',
                changeOrigin: true
            }
        }
    }
})
